package com.melesta.obb;

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Messenger;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.google.android.vending.expansion.downloader.DownloadProgressInfo;
import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller;
import com.google.android.vending.expansion.downloader.DownloaderServiceMarshaller;
import com.google.android.vending.expansion.downloader.Helpers;
import com.google.android.vending.expansion.downloader.IDownloaderClient;
import com.google.android.vending.expansion.downloader.IDownloaderService;
import com.google.android.vending.expansion.downloader.IStub;
import com.melesta.engine.EngineActivity;
import com.melesta.engine.R.id;
import com.melesta.engine.R.layout;
import com.melesta.engine.R.string;
import com.melesta.engine.R.xml;
import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
import org.xmlpull.v1.XmlPullParserException;

public class ObbDownloaderActivity extends Activity
  implements IDownloaderClient
{
  private static final String LOG_TAG = "LVLDownloader";
  private static final float SMOOTHING_FACTOR = 0.005F;
  private static ArrayList<XAPKFile> xAPKS = new ArrayList();
  private TextView mAverageSpeed;
  private boolean mCancelValidation;
  private View mCellMessage;
  private View mDashboard;
  private IStub mDownloaderClientStub;
  private ProgressBar mPB;
  private Button mPauseButton;
  private TextView mProgressFraction;
  private TextView mProgressPercent;
  private IDownloaderService mRemoteService;
  private int mState;
  private boolean mStatePaused;
  private TextView mStatusText;
  private TextView mTimeRemaining;
  private Button mWiFiSettingsButton;

  private boolean expansionFilesValidated()
  {
    Iterator localIterator = xAPKS.iterator();
    while (localIterator.hasNext())
    {
      XAPKFile localXAPKFile = (XAPKFile)localIterator.next();
      String str = Helpers.getExpansionAPKFileName(this, localXAPKFile.mIsMain, localXAPKFile.mFileVersion);
      if (!Helpers.doesFileExist(this, str, localXAPKFile.mFileSize, false))
        return false;
      if (!new File(Helpers.generateSaveFileName(this, str + ".verified")).exists())
        return false;
    }
    return true;
  }

  private void initializeDownloadUI()
  {
    this.mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this, ObbDownloaderService.class);
    setContentView(R.layout.main);
    this.mPB = ((ProgressBar)findViewById(R.id.progressBar));
    this.mStatusText = ((TextView)findViewById(R.id.statusText));
    this.mProgressFraction = ((TextView)findViewById(R.id.progressAsFraction));
    this.mProgressPercent = ((TextView)findViewById(R.id.progressAsPercentage));
    this.mAverageSpeed = ((TextView)findViewById(R.id.progressAverageSpeed));
    this.mTimeRemaining = ((TextView)findViewById(R.id.progressTimeRemaining));
    this.mDashboard = findViewById(R.id.downloaderDashboard);
    this.mCellMessage = findViewById(R.id.approveCellular);
    this.mPauseButton = ((Button)findViewById(R.id.pauseButton));
    this.mWiFiSettingsButton = ((Button)findViewById(R.id.wifiSettingsButton));
    this.mPauseButton.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        ObbDownloaderActivity localObbDownloaderActivity;
        if (ObbDownloaderActivity.this.mStatePaused)
        {
          ObbDownloaderActivity.this.mRemoteService.requestContinueDownload();
          localObbDownloaderActivity = ObbDownloaderActivity.this;
          if (ObbDownloaderActivity.this.mStatePaused)
            break label60;
        }
        label60: for (boolean bool = true; ; bool = false)
        {
          localObbDownloaderActivity.setButtonPausedState(bool);
          return;
          ObbDownloaderActivity.this.mRemoteService.requestPauseDownload();
          break;
        }
      }
    });
    this.mWiFiSettingsButton.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        ObbDownloaderActivity.this.startActivity(new Intent("android.settings.WIFI_SETTINGS"));
      }
    });
    ((Button)findViewById(R.id.resumeOverCellular)).setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        if (ObbDownloaderActivity.this.mRemoteService != null)
        {
          ObbDownloaderActivity.this.mRemoteService.setDownloadFlags(1);
          ObbDownloaderActivity.this.mRemoteService.requestContinueDownload();
        }
        if (ObbDownloaderActivity.this.mCellMessage != null)
          ObbDownloaderActivity.this.mCellMessage.setVisibility(8);
      }
    });
  }

  private void setButtonPausedState(boolean paramBoolean)
  {
    this.mStatePaused = paramBoolean;
    if (paramBoolean);
    for (int i = R.string.text_button_resume; ; i = R.string.text_button_pause)
    {
      this.mPauseButton.setText(i);
      return;
    }
  }

  private void setState(int paramInt)
  {
    if (this.mState != paramInt)
    {
      this.mState = paramInt;
      this.mStatusText.setText(Helpers.getDownloaderStringResourceIDFromState(paramInt));
    }
  }

  public static void show(Activity paramActivity)
  {
    paramActivity.startActivity(new Intent(paramActivity, ObbDownloaderActivity.class));
  }

  private void startEngineActivity()
  {
    Intent localIntent = new Intent(this, EngineActivity.class);
    localIntent.setFlags(538968064);
    startActivity(localIntent);
  }

  boolean expansionFilesDelivered()
  {
    Iterator localIterator = xAPKS.iterator();
    while (localIterator.hasNext())
    {
      XAPKFile localXAPKFile = (XAPKFile)localIterator.next();
      String str = Helpers.getExpansionAPKFileName(this, localXAPKFile.mIsMain, localXAPKFile.mFileVersion);
      if (!Helpers.doesFileExist(this, str, localXAPKFile.mFileSize, false))
      {
        Log.d("engine", "Need to download " + str + " | " + Helpers.generateSaveFileName(this, str));
        return false;
      }
    }
    return true;
  }

  public int getVersion()
  {
    try
    {
      int i = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
      return i;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
    }
    return 0;
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    Log.d("engine", getResources().getConfiguration().toString());
    DisplayMetrics localDisplayMetrics = getResources().getDisplayMetrics();
    if (localDisplayMetrics.densityDpi == 240)
    {
      Log.d("engine", "DENSITY_HIGH");
      if ((0xF & getResources().getConfiguration().screenLayout) != 3)
        break label317;
      Log.d("engine", "Large screen");
    }
    label77: int i;
    label317: 
    do
    {
      Intent localIntent2;
      try
      {
        while (true)
        {
          XmlResourceParser localXmlResourceParser = getResources().getXml(R.xml.obb);
          xAPKS.clear();
          try
          {
            localXmlResourceParser.next();
            localXmlResourceParser.next();
            int j = localXmlResourceParser.next();
            while (true)
              if (j != 1)
              {
                if (j == 2)
                {
                  String str = localXmlResourceParser.getName();
                  int k = localXmlResourceParser.getAttributeIntValue(null, "version", -1);
                  int m = localXmlResourceParser.getAttributeIntValue(null, "size", -1);
                  XAPKFile localXAPKFile = new XAPKFile(str.equals("main"), k, m);
                  xAPKS.add(localXAPKFile);
                }
                int n = localXmlResourceParser.next();
                j = n;
                continue;
                if (localDisplayMetrics.densityDpi == 120)
                {
                  Log.d("engine", "DENSITY_LOW");
                  break;
                }
                if (localDisplayMetrics.densityDpi == 160)
                {
                  Log.d("engine", "DENSITY_MEDIUM");
                  break;
                }
                if (localDisplayMetrics.densityDpi == 320)
                {
                  Log.d("engine", "DENSITY_XHIGH");
                  break;
                }
                Log.d("engine", "DENSITY_" + localDisplayMetrics.densityDpi);
                break;
                if ((0xF & getResources().getConfiguration().screenLayout) == 4)
                {
                  Log.d("engine", "xLarge screen");
                  break label77;
                }
                if ((0xF & getResources().getConfiguration().screenLayout) == 2)
                {
                  Log.d("engine", "Normal screen");
                  break label77;
                }
                if ((0xF & getResources().getConfiguration().screenLayout) == 1)
                {
                  Log.d("engine", "Small screen");
                  break label77;
                }
                Log.d("engine", "Unknown screen");
              }
          }
          catch (XmlPullParserException localXmlPullParserException)
          {
            localXmlPullParserException.printStackTrace();
            Log.d("ToyDefense", "BOARD:" + Build.BOARD);
            Log.d("ToyDefense", "BRAND:" + Build.BRAND);
            Log.d("ToyDefense", "CPU_ABI:" + Build.CPU_ABI);
            Log.d("ToyDefense", "CPU_ABI2:" + Build.CPU_ABI2);
            Log.d("ToyDefense", "DEVICE:" + Build.DEVICE);
            Log.d("ToyDefense", "DISPLAY:" + Build.DISPLAY);
            Log.d("ToyDefense", "FINGERPRINT:" + Build.FINGERPRINT);
            Log.d("ToyDefense", "HARDWARE:" + Build.HARDWARE);
            Log.d("ToyDefense", "HOST:" + Build.HOST);
            Log.d("ToyDefense", "ID:" + Build.ID);
            Log.d("ToyDefense", "MANUFACTURER:" + Build.MANUFACTURER);
            Log.d("ToyDefense", "MODEL:" + Build.MODEL);
            Log.d("ToyDefense", "PRODUCT:" + Build.PRODUCT);
            Log.d("ToyDefense", "RADIO:" + Build.RADIO);
            Log.d("ToyDefense", "SERIAL:" + Build.SERIAL);
            Log.d("ToyDefense", "TAGS:" + Build.TAGS);
            Log.d("ToyDefense", "TYPE:" + Build.TYPE);
            Log.d("ToyDefense", "UNKNOWN:unknown");
            Log.d("ToyDefense", "USER:" + Build.USER);
            if (expansionFilesDelivered())
              break label1116;
          }
        }
        try
        {
          initializeDownloadUI();
          Intent localIntent1 = getIntent();
          localIntent2 = new Intent(this, getClass());
          localIntent2.setFlags(335544320);
          localIntent2.setAction(localIntent1.getAction());
          if (localIntent1.getCategories() != null)
          {
            Iterator localIterator = localIntent1.getCategories().iterator();
            while (localIterator.hasNext())
              localIntent2.addCategory((String)localIterator.next());
          }
        }
        catch (PackageManager.NameNotFoundException localNameNotFoundException)
        {
          Log.e("LVLDownloader", "Cannot find own package! MAYDAY!");
          localNameNotFoundException.printStackTrace();
          return;
        }
      }
      catch (Exception localException)
      {
        RuntimeException localRuntimeException = new RuntimeException(localException);
        throw localRuntimeException;
      }
      i = DownloaderClientMarshaller.startDownloadServiceIfRequired(this, PendingIntent.getActivity(this, 0, localIntent2, 134217728), ObbDownloaderService.class);
    }
    while (i == 0);
    return;
    label1116: finish();
    startEngineActivity();
  }

  protected void onDestroy()
  {
    this.mCancelValidation = true;
    super.onDestroy();
  }

  public void onDownloadProgress(DownloadProgressInfo paramDownloadProgressInfo)
  {
    if (paramDownloadProgressInfo.mTimeRemaining < 0L)
      paramDownloadProgressInfo.mTimeRemaining = 100L;
    if (paramDownloadProgressInfo.mOverallProgress > paramDownloadProgressInfo.mOverallTotal)
      paramDownloadProgressInfo.mOverallProgress = paramDownloadProgressInfo.mOverallTotal;
    TextView localTextView1 = this.mAverageSpeed;
    int i = R.string.kilobytes_per_second;
    Object[] arrayOfObject1 = new Object[1];
    arrayOfObject1[0] = Helpers.getSpeedString(paramDownloadProgressInfo.mCurrentSpeed);
    localTextView1.setText(getString(i, arrayOfObject1));
    TextView localTextView2 = this.mTimeRemaining;
    int j = R.string.time_remaining;
    Object[] arrayOfObject2 = new Object[1];
    arrayOfObject2[0] = Helpers.getTimeRemaining(paramDownloadProgressInfo.mTimeRemaining);
    localTextView2.setText(getString(j, arrayOfObject2));
    paramDownloadProgressInfo.mOverallTotal = paramDownloadProgressInfo.mOverallTotal;
    this.mPB.setMax((int)(paramDownloadProgressInfo.mOverallTotal >> 8));
    this.mPB.setProgress((int)(paramDownloadProgressInfo.mOverallProgress >> 8));
    this.mProgressPercent.setText(Long.toString(100L * paramDownloadProgressInfo.mOverallProgress / paramDownloadProgressInfo.mOverallTotal) + "%");
    this.mProgressFraction.setText(Helpers.getDownloadProgressString(paramDownloadProgressInfo.mOverallProgress, paramDownloadProgressInfo.mOverallTotal));
  }

  public void onDownloadStateChanged(int paramInt)
  {
    setState(paramInt);
    int i = 1;
    int j = 0;
    boolean bool1;
    boolean bool2;
    int k;
    switch (paramInt)
    {
    case 6:
    case 10:
    case 11:
    case 13:
    case 17:
    default:
      bool1 = true;
      bool2 = true;
      i = 1;
      if (i != 0)
      {
        k = 0;
        label115: if (this.mDashboard.getVisibility() != k)
          this.mDashboard.setVisibility(k);
        if (j == 0)
          break label277;
      }
      break;
    case 1:
    case 2:
    case 3:
    case 4:
    case 15:
    case 16:
    case 18:
    case 19:
    case 8:
    case 9:
    case 7:
    case 12:
    case 14:
    case 5:
    }
    label277: for (int m = 0; ; m = 8)
    {
      if (this.mCellMessage.getVisibility() != m)
        this.mCellMessage.setVisibility(m);
      this.mPB.setIndeterminate(bool2);
      setButtonPausedState(bool1);
      return;
      bool2 = true;
      bool1 = false;
      j = 0;
      break;
      i = 1;
      bool2 = true;
      bool1 = false;
      j = 0;
      break;
      i = 1;
      bool2 = false;
      bool1 = false;
      j = 0;
      break;
      bool1 = true;
      bool2 = false;
      j = 0;
      i = 0;
      break;
      bool1 = true;
      j = 1;
      bool2 = false;
      i = 0;
      break;
      bool1 = true;
      bool2 = false;
      j = 0;
      break;
      bool1 = true;
      bool2 = false;
      j = 0;
      break;
      validateXAPKZipFiles();
      return;
      k = 8;
      break label115;
    }
  }

  public void onServiceConnected(Messenger paramMessenger)
  {
    this.mRemoteService = DownloaderServiceMarshaller.CreateProxy(paramMessenger);
    this.mRemoteService.onClientUpdated(this.mDownloaderClientStub.getMessenger());
  }

  protected void onStart()
  {
    if (this.mDownloaderClientStub != null)
      this.mDownloaderClientStub.connect(this);
    super.onStart();
  }

  protected void onStop()
  {
    if (this.mDownloaderClientStub != null)
      this.mDownloaderClientStub.disconnect(this);
    super.onStop();
  }

  void validateXAPKZipFiles()
  {
    AsyncTask local1 = new AsyncTask()
    {
      // ERROR //
      protected Boolean doInBackground(Object[] paramAnonymousArrayOfObject)
      {
        // Byte code:
        //   0: invokestatic 26	com/melesta/obb/ObbDownloaderActivity:access$500	()Ljava/util/ArrayList;
        //   3: invokevirtual 32	java/util/ArrayList:iterator	()Ljava/util/Iterator;
        //   6: astore_2
        //   7: aload_2
        //   8: invokeinterface 38 1 0
        //   13: ifeq +601 -> 614
        //   16: aload_2
        //   17: invokeinterface 42 1 0
        //   22: checkcast 44	com/melesta/obb/ObbDownloaderActivity$XAPKFile
        //   25: astore_3
        //   26: aload_0
        //   27: getfield 16	com/melesta/obb/ObbDownloaderActivity$1:this$0	Lcom/melesta/obb/ObbDownloaderActivity;
        //   30: aload_3
        //   31: getfield 48	com/melesta/obb/ObbDownloaderActivity$XAPKFile:mIsMain	Z
        //   34: aload_3
        //   35: getfield 52	com/melesta/obb/ObbDownloaderActivity$XAPKFile:mFileVersion	I
        //   38: invokestatic 58	com/google/android/vending/expansion/downloader/Helpers:getExpansionAPKFileName	(Landroid/content/Context;ZI)Ljava/lang/String;
        //   41: astore 4
        //   43: aload_0
        //   44: getfield 16	com/melesta/obb/ObbDownloaderActivity$1:this$0	Lcom/melesta/obb/ObbDownloaderActivity;
        //   47: aload 4
        //   49: aload_3
        //   50: getfield 62	com/melesta/obb/ObbDownloaderActivity$XAPKFile:mFileSize	J
        //   53: iconst_0
        //   54: invokestatic 66	com/google/android/vending/expansion/downloader/Helpers:doesFileExist	(Landroid/content/Context;Ljava/lang/String;JZ)Z
        //   57: ifne +12 -> 69
        //   60: iconst_0
        //   61: invokestatic 72	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
        //   64: astore 40
        //   66: aload 40
        //   68: areturn
        //   69: aload_0
        //   70: getfield 16	com/melesta/obb/ObbDownloaderActivity$1:this$0	Lcom/melesta/obb/ObbDownloaderActivity;
        //   73: aload 4
        //   75: invokestatic 76	com/google/android/vending/expansion/downloader/Helpers:generateSaveFileName	(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
        //   78: astore 5
        //   80: ldc 77
        //   82: newarray byte
        //   84: astore 6
        //   86: new 79	com/android/vending/expansion/zipfile/ZipResourceFile
        //   89: dup
        //   90: aload 5
        //   92: invokespecial 82	com/android/vending/expansion/zipfile/ZipResourceFile:<init>	(Ljava/lang/String;)V
        //   95: astore 7
        //   97: aload 7
        //   99: invokevirtual 86	com/android/vending/expansion/zipfile/ZipResourceFile:getAllEntries	()[Lcom/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO;
        //   102: astore 9
        //   104: lconst_0
        //   105: lstore 10
        //   107: aload 9
        //   109: arraylength
        //   110: istore 12
        //   112: iconst_0
        //   113: istore 13
        //   115: iload 13
        //   117: iload 12
        //   119: if_icmpge +22 -> 141
        //   122: lload 10
        //   124: aload 9
        //   126: iload 13
        //   128: aaload
        //   129: getfield 91	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:mCompressedLength	J
        //   132: ladd
        //   133: lstore 10
        //   135: iinc 13 1
        //   138: goto -23 -> 115
        //   141: fconst_0
        //   142: fstore 14
        //   144: lload 10
        //   146: lstore 15
        //   148: aload 9
        //   150: arraylength
        //   151: istore 17
        //   153: iconst_0
        //   154: istore 18
        //   156: iload 18
        //   158: iload 17
        //   160: if_icmpge +401 -> 561
        //   163: aload 9
        //   165: iload 18
        //   167: aaload
        //   168: astore 19
        //   170: ldc2_w 92
        //   173: aload 19
        //   175: getfield 96	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:mCRC32	J
        //   178: lcmp
        //   179: ifeq +449 -> 628
        //   182: aload 19
        //   184: getfield 99	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:mUncompressedLength	J
        //   187: lstore 20
        //   189: new 101	java/util/zip/CRC32
        //   192: dup
        //   193: invokespecial 102	java/util/zip/CRC32:<init>	()V
        //   196: astore 22
        //   198: new 104	java/io/DataInputStream
        //   201: dup
        //   202: aload 7
        //   204: aload 19
        //   206: getfield 108	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:mFileName	Ljava/lang/String;
        //   209: invokevirtual 112	com/android/vending/expansion/zipfile/ZipResourceFile:getInputStream	(Ljava/lang/String;)Ljava/io/InputStream;
        //   212: invokespecial 115	java/io/DataInputStream:<init>	(Ljava/io/InputStream;)V
        //   215: astore 23
        //   217: invokestatic 121	android/os/SystemClock:uptimeMillis	()J
        //   220: lstore 26
        //   222: lload 20
        //   224: lconst_0
        //   225: lcmp
        //   226: ifle +214 -> 440
        //   229: lload 20
        //   231: aload 6
        //   233: arraylength
        //   234: i2l
        //   235: lcmp
        //   236: ifle +190 -> 426
        //   239: aload 6
        //   241: arraylength
        //   242: i2l
        //   243: lstore 28
        //   245: lload 28
        //   247: l2i
        //   248: istore 30
        //   250: aload 23
        //   252: aload 6
        //   254: iconst_0
        //   255: iload 30
        //   257: invokevirtual 125	java/io/DataInputStream:readFully	([BII)V
        //   260: aload 22
        //   262: aload 6
        //   264: iconst_0
        //   265: iload 30
        //   267: invokevirtual 128	java/util/zip/CRC32:update	([BII)V
        //   270: lload 20
        //   272: iload 30
        //   274: i2l
        //   275: lsub
        //   276: lstore 20
        //   278: invokestatic 121	android/os/SystemClock:uptimeMillis	()J
        //   281: lstore 31
        //   283: lload 31
        //   285: lload 26
        //   287: lsub
        //   288: lstore 33
        //   290: lload 33
        //   292: lconst_0
        //   293: lcmp
        //   294: ifle +83 -> 377
        //   297: iload 30
        //   299: i2f
        //   300: lload 33
        //   302: l2f
        //   303: fdiv
        //   304: fstore 35
        //   306: fconst_0
        //   307: fload 14
        //   309: fcmpl
        //   310: ifeq +123 -> 433
        //   313: ldc 129
        //   315: fload 35
        //   317: fmul
        //   318: ldc 130
        //   320: fload 14
        //   322: fmul
        //   323: fadd
        //   324: fstore 14
        //   326: lload 15
        //   328: iload 30
        //   330: i2l
        //   331: lsub
        //   332: lstore 15
        //   334: lload 15
        //   336: l2f
        //   337: fload 14
        //   339: fdiv
        //   340: f2l
        //   341: lstore 36
        //   343: iconst_1
        //   344: anewarray 132	com/google/android/vending/expansion/downloader/DownloadProgressInfo
        //   347: astore 38
        //   349: aload 38
        //   351: iconst_0
        //   352: new 132	com/google/android/vending/expansion/downloader/DownloadProgressInfo
        //   355: dup
        //   356: lload 10
        //   358: lload 10
        //   360: lload 15
        //   362: lsub
        //   363: lload 36
        //   365: fload 14
        //   367: invokespecial 135	com/google/android/vending/expansion/downloader/DownloadProgressInfo:<init>	(JJJF)V
        //   370: aastore
        //   371: aload_0
        //   372: aload 38
        //   374: invokevirtual 139	com/melesta/obb/ObbDownloaderActivity$1:publishProgress	([Ljava/lang/Object;)V
        //   377: lload 31
        //   379: lstore 26
        //   381: aload_0
        //   382: getfield 16	com/melesta/obb/ObbDownloaderActivity$1:this$0	Lcom/melesta/obb/ObbDownloaderActivity;
        //   385: invokestatic 143	com/melesta/obb/ObbDownloaderActivity:access$300	(Lcom/melesta/obb/ObbDownloaderActivity;)Z
        //   388: ifeq -166 -> 222
        //   391: iconst_1
        //   392: invokestatic 72	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
        //   395: astore 39
        //   397: aload 39
        //   399: astore 40
        //   401: aload 23
        //   403: ifnull -337 -> 66
        //   406: aload 23
        //   408: invokevirtual 146	java/io/DataInputStream:close	()V
        //   411: aload 40
        //   413: areturn
        //   414: astore 8
        //   416: aload 8
        //   418: invokevirtual 149	java/io/IOException:printStackTrace	()V
        //   421: iconst_0
        //   422: invokestatic 72	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
        //   425: areturn
        //   426: lload 20
        //   428: lstore 28
        //   430: goto -185 -> 245
        //   433: fload 35
        //   435: fstore 14
        //   437: goto -111 -> 326
        //   440: aload 22
        //   442: invokevirtual 152	java/util/zip/CRC32:getValue	()J
        //   445: aload 19
        //   447: getfield 96	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:mCRC32	J
        //   450: lcmp
        //   451: ifeq +84 -> 535
        //   454: ldc 154
        //   456: new 156	java/lang/StringBuilder
        //   459: dup
        //   460: invokespecial 157	java/lang/StringBuilder:<init>	()V
        //   463: ldc 159
        //   465: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   468: aload 19
        //   470: getfield 108	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:mFileName	Ljava/lang/String;
        //   473: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   476: invokevirtual 167	java/lang/StringBuilder:toString	()Ljava/lang/String;
        //   479: invokestatic 173	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
        //   482: pop
        //   483: ldc 154
        //   485: new 156	java/lang/StringBuilder
        //   488: dup
        //   489: invokespecial 157	java/lang/StringBuilder:<init>	()V
        //   492: ldc 175
        //   494: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   497: aload 19
        //   499: invokevirtual 178	com/android/vending/expansion/zipfile/ZipResourceFile$ZipEntryRO:getZipFileName	()Ljava/lang/String;
        //   502: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   505: invokevirtual 167	java/lang/StringBuilder:toString	()Ljava/lang/String;
        //   508: invokestatic 173	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
        //   511: pop
        //   512: iconst_0
        //   513: invokestatic 72	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
        //   516: astore 43
        //   518: aload 43
        //   520: astore 40
        //   522: aload 23
        //   524: ifnull -458 -> 66
        //   527: aload 23
        //   529: invokevirtual 146	java/io/DataInputStream:close	()V
        //   532: aload 40
        //   534: areturn
        //   535: aload 23
        //   537: ifnull +91 -> 628
        //   540: aload 23
        //   542: invokevirtual 146	java/io/DataInputStream:close	()V
        //   545: goto +83 -> 628
        //   548: aload 25
        //   550: ifnull +8 -> 558
        //   553: aload 25
        //   555: invokevirtual 146	java/io/DataInputStream:close	()V
        //   558: aload 24
        //   560: athrow
        //   561: new 180	java/io/File
        //   564: dup
        //   565: new 156	java/lang/StringBuilder
        //   568: dup
        //   569: invokespecial 157	java/lang/StringBuilder:<init>	()V
        //   572: aload 5
        //   574: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   577: ldc 182
        //   579: invokevirtual 163	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
        //   582: invokevirtual 167	java/lang/StringBuilder:toString	()Ljava/lang/String;
        //   585: invokespecial 183	java/io/File:<init>	(Ljava/lang/String;)V
        //   588: astore 44
        //   590: aload 44
        //   592: ifnull -585 -> 7
        //   595: aload 44
        //   597: invokevirtual 186	java/io/File:createNewFile	()Z
        //   600: pop
        //   601: goto -594 -> 7
        //   604: astore 45
        //   606: aload 45
        //   608: invokevirtual 149	java/io/IOException:printStackTrace	()V
        //   611: goto -604 -> 7
        //   614: iconst_1
        //   615: invokestatic 72	java/lang/Boolean:valueOf	(Z)Ljava/lang/Boolean;
        //   618: areturn
        //   619: astore 24
        //   621: aload 23
        //   623: astore 25
        //   625: goto -77 -> 548
        //   628: iinc 18 1
        //   631: goto -475 -> 156
        //   634: astore 24
        //   636: aconst_null
        //   637: astore 25
        //   639: goto -91 -> 548
        //
        // Exception table:
        //   from	to	target	type
        //   86	104	414	java/io/IOException
        //   107	112	414	java/io/IOException
        //   122	135	414	java/io/IOException
        //   148	153	414	java/io/IOException
        //   163	198	414	java/io/IOException
        //   406	411	414	java/io/IOException
        //   527	532	414	java/io/IOException
        //   540	545	414	java/io/IOException
        //   553	558	414	java/io/IOException
        //   558	561	414	java/io/IOException
        //   595	601	604	java/io/IOException
        //   217	222	619	finally
        //   229	245	619	finally
        //   250	270	619	finally
        //   278	283	619	finally
        //   297	306	619	finally
        //   334	377	619	finally
        //   381	397	619	finally
        //   440	518	619	finally
        //   198	217	634	finally
      }

      protected void onPostExecute(Boolean paramAnonymousBoolean)
      {
        if (paramAnonymousBoolean.booleanValue())
        {
          ObbDownloaderActivity.this.mDashboard.setVisibility(0);
          ObbDownloaderActivity.this.mCellMessage.setVisibility(8);
          ObbDownloaderActivity.this.mStatusText.setText(R.string.text_validation_complete);
          ObbDownloaderActivity.this.finish();
          ObbDownloaderActivity.this.finish();
          ObbDownloaderActivity.this.startEngineActivity();
          ObbDownloaderActivity.this.mPauseButton.setVisibility(8);
        }
        while (true)
        {
          super.onPostExecute(paramAnonymousBoolean);
          return;
          ObbDownloaderActivity.this.mDashboard.setVisibility(0);
          ObbDownloaderActivity.this.mCellMessage.setVisibility(8);
          ObbDownloaderActivity.this.mStatusText.setText(R.string.text_validation_failed);
          ObbDownloaderActivity.this.mPauseButton.setOnClickListener(new View.OnClickListener()
          {
            public void onClick(View paramAnonymous2View)
            {
              ObbDownloaderActivity.this.finish();
            }
          });
          ObbDownloaderActivity.this.mPauseButton.setText(17039360);
        }
      }

      protected void onPreExecute()
      {
        ObbDownloaderActivity.this.mDashboard.setVisibility(0);
        ObbDownloaderActivity.this.mCellMessage.setVisibility(8);
        ObbDownloaderActivity.this.mStatusText.setText(R.string.text_verifying_download);
        ObbDownloaderActivity.this.mPauseButton.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymous2View)
          {
            ObbDownloaderActivity.access$302(ObbDownloaderActivity.this, true);
          }
        });
        ObbDownloaderActivity.this.mPauseButton.setText(R.string.text_button_cancel_verify);
        super.onPreExecute();
      }

      protected void onProgressUpdate(DownloadProgressInfo[] paramAnonymousArrayOfDownloadProgressInfo)
      {
        ObbDownloaderActivity.this.onDownloadProgress(paramAnonymousArrayOfDownloadProgressInfo[0]);
        super.onProgressUpdate(paramAnonymousArrayOfDownloadProgressInfo);
      }
    };
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = new Object();
    local1.execute(arrayOfObject);
  }

  private static class XAPKFile
  {
    public final long mFileSize;
    public final int mFileVersion;
    public final boolean mIsMain;

    XAPKFile(boolean paramBoolean, int paramInt, long paramLong)
    {
      this.mIsMain = paramBoolean;
      this.mFileVersion = paramInt;
      this.mFileSize = paramLong;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.melesta.obb.ObbDownloaderActivity
 * JD-Core Version:    0.6.2
 */